<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var t = '212322ffaa2224432asd43545aadd55553'
        // 四个连续相同的数字 2222  5555
        var reg = /(\d)\1\1\1/g
        console.log(t.match(reg));

        // fa22  fa开头的连续两个数字
        var reg1 = /fa(\d)\1/g
        console.log(t.match(reg1));

        // 2244  
        var reg2 = /(\d)\1(\d)\2/g
        console.log(t.match(reg2));

        // ffaa  aadd
        var reg3 = /([a-z])\1([a-z])\2/g
        console.log(t.match(reg3));
    </script>
</body>

</html>